local que_miaoli = fk.CreateSkill {
    name = "que_miaoli",
    anim_type = "control",
}
Fk:loadTranslationTable {
    ["que_miaoli"] = "喵戾",
    [":que_miaoli"] = "准备阶段，你可以选择至多三名其他角色，对这些角色造成一点伤害并依次视为使用一张【杀】，受到此【杀】伤害的角色摸X张牌(X为你已损失的体力值)。",
    ["#que_miaoli_askchos"] = "喵戾：你可以选择至多三名角色，对其造成伤害并视为使用【杀】。",
}
que_miaoli:addEffect(fk.EventPhaseStart, {
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(que_miaoli.name) and player.phase == Player.Start
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        local tos = room:askToChoosePlayers(player, {
            skill_name = que_miaoli.name,
            min_num = 1,
            max_num = 3,
            targets = room:getOtherPlayers(player, false),
            prompt = "#que_miaoli_askchos",
            cancelable = true,
        })
        if #tos > 0 then
            room:sortByAction(tos)
            event:setCostData(self, { tos = tos })
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local tos = event:getCostData(self).tos
        room:sortByAction(tos)
        if player:getMark("@@que_lianyu") == 0 then
            for _, p in ipairs(tos) do
                if player.dead then return end
                if not p.dead then
                    room:damage {
                        from = player,
                        to = p,
                        damage = 1
                    }
                end
            end
        end
        for _, p in ipairs(tos) do
            if player.dead then return end
            if not p.dead then
                local use = room:useVirtualCard("slash", nil, player, p, que_miaoli.name, true)
                if use then
                    if use.damageDealt and player:isWounded() then
                        p:drawCards(player:getLostHp(), que_miaoli.name)
                    end
                end
            end
        end
        if player:getMark("@@que_lianyu") > 0 then
            room:setPlayerMark(player, "@@que_lianyu", 0)
        end
    end,
})
return que_miaoli
